Skip to content

Conversation

@pcarleton
Copy link
Member

Summary

Adds an auth-test-server to the conformance test suite for testing server-side OAuth implementation.

What's New

  • src/conformance/auth-test-server.ts - MCP server with OAuth authentication
  • Updated src/conformance/README.md with documentation

Features

  • Uses SDK's requireBearerAuth middleware for authentication
  • Validates tokens via the authorization server's introspection endpoint (RFC 7662)
  • Serves Protected Resource Metadata at /.well-known/oauth-protected-resource
  • Requires MCP_CONFORMANCE_AUTH_SERVER_URL environment variable

Usage

# Start with a fake auth server
MCP_CONFORMANCE_AUTH_SERVER_URL=http://localhost:3000 \
  npx tsx src/conformance/auth-test-server.ts

Related

This server is used by the conformance repo's server auth tests (modelcontextprotocol/conformance#105).

@pcarleton pcarleton requested a review from a team as a code owner January 14, 2026 12:02
@changeset-bot
Copy link

changeset-bot bot commented Jan 14, 2026

⚠️ No Changeset found

Latest commit: e9377fb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 14, 2026

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/client@1384

@modelcontextprotocol/server

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server@1384

@modelcontextprotocol/express

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/express@1384

@modelcontextprotocol/hono

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/hono@1384

@modelcontextprotocol/node

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/node@1384

commit: e9377fb

// Configure CORS to expose Mcp-Session-Id header for browser-based clients
app.use(
cors({
origin: '*',

Check warning

Code scanning / CodeQL

Permissive CORS configuration Medium

CORS Origin allows broad access due to
permissive or user controlled value
.
pcarleton and others added 3 commits January 23, 2026 18:45
- MCP server with Bearer token authentication
- Uses SDK's requireBearerAuth middleware
- Validates tokens via AS introspection endpoint (RFC 7662)
- Serves Protected Resource Metadata at /.well-known/oauth-protected-resource
- Designed for server auth conformance tests
- Add admin-action tool requiring 'admin' scope
- Add scope-checking middleware for privileged tools
- Returns 403 insufficient_scope for missing admin scope
- Add scopes_supported to PRM response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants